import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '用户',
    align: "center",
    dataIndex: 'userId_dictText'
  },
  {
    title: '用户手机号',
    align: "center",
    dataIndex: 'userPhone'
  },
  {
    title: '行驶证',
    align: "center",
    dataIndex: 'drivingLicense',
    customRender: render.renderImage,
  },
  {
    title: '车辆识别代号',
    align: "center",
    dataIndex: 'drivingFVin'
  },
  {
    title: '住址',
    align: "center",
    dataIndex: 'drivingFAddr'
  },
  {
    title: '发证日期',
    align: "center",
    dataIndex: 'drivingFPubDate'
  },
  {
    title: '发证单位',
    align: "center",
    dataIndex: 'drivingFPubOrg'
  },
  {
    title: '品牌型号',
    align: "center",
    dataIndex: 'drivingFBrandModel'
  },
  {
    title: '所有人',
    align: "center",
    dataIndex: 'drivingFAny'
  },
  {
    title: '使用性质',
    align: "center",
    dataIndex: 'drivingFUseProperty'
  },
  {
    title: '发动机号码',
    align: "center",
    dataIndex: 'drivingFEngineNo'
  },
  {
    title: '号牌号码',
    align: "center",
    dataIndex: 'drivingFVehicleNo'
  },
  {
    title: '注册日期',
    align: "center",
    dataIndex: 'drivingFRegDate'
  },
  {
    title: '检验记录',
    align: "center",
    dataIndex: 'drivingBCheckRecord'
  },
  {
    title: '核定载质量',
    align: "center",
    dataIndex: 'drivingBVgwr'
  },
  {
    title: '整备质量',
    align: "center",
    dataIndex: 'drivingBCurbWeight'
  },
  {
    title: '外廓尺寸',
    align: "center",
    dataIndex: 'drivingBLwh'
  },
  {
    title: ' 核定载人数',
    align: "center",
    dataIndex: 'drivingBPax'
  },
  {
    title: '总质量',
    align: "center",
    dataIndex: 'drivingBGvs'
  },
  {
    title: '燃油类型',
    align: "center",
    dataIndex: 'drivingBFuelType'
  },
  {
    title: '准牵引总质量',
    align: "center",
    dataIndex: 'drivingBGcwr'
  },
  {
    title: '备注',
    align: "center",
    dataIndex: 'drivingBRemark'
  },
  {
    title: '档案编号',
    align: "center",
    dataIndex: 'drivingBDocNo'
  },
  {
    title: '号牌号码',
    align: "center",
    dataIndex: 'drivingBVehicleNo'
  },
  {
    title: '证芯编号',
    align: "center",
    dataIndex: 'drivingBCcn'
  },
  {
    title: '道路运输证',
    align: "center",
    dataIndex: 'roadTransportCertificate',
    customRender: render.renderImage,
  },
  {
    title: '道路运输证号',
    align: "center",
    dataIndex: 'roadNo'
  },
  {
    title: '车牌号码',
    align: "center",
    dataIndex: 'roadVehicleNo'
  },
  {
    title: '经济类型',
    align: "center",
    dataIndex: 'roadEconType'
  },
  {
    title: '经营范围',
    align: "center",
    dataIndex: 'roadBusiRange'
  },
  {
    title: '车辆类型',
    align: "center",
    dataIndex: 'roadVehicleType'
  },
  {
    title: '吨座位',
    align: "center",
    dataIndex: 'roadTon'
  },
  {
    title: '备注',
    align: "center",
    dataIndex: 'roadRemark'
  },
  {
    title: '经营许可证号',
    align: "center",
    dataIndex: 'roadBusiPermitNo'
  },
  {
    title: '车辆毫米_高',
    align: "center",
    dataIndex: 'roadVehicleMmHeight'
  },
  {
    title: '车辆毫米_宽',
    align: "center",
    dataIndex: 'roadVehicleMmWeight'
  },
  {
    title: '车辆毫米_长',
    align: "center",
    dataIndex: 'roadVehicleMmLong'
  },
  {
    title: '发证日期',
    align: "center",
    dataIndex: 'roadPubDate'
  },
  {
    title: '地址',
    align: "center",
    dataIndex: 'roadAddr'
  },
  {
    title: '业户名称',
    align: "center",
    dataIndex: 'roadUserName'
  },
  {
    title: '初领日期',
    align: "center",
    dataIndex: 'roadFirstDate'
  },
  {
    title: '车辆状态',
    align: "center",
    dataIndex: 'vehicleStatus_dictText'
  },
  {
    title: '状态',
    align: "center",
    dataIndex: 'status_dictText'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "用户手机号",
    field: 'userPhone',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "车辆识别代号",
    field: 'drivingFVin',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "号牌号码",
    field: 'drivingFVehicleNo',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "证芯编号",
    field: 'drivingBCcn',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "道路运输证号",
    field: 'roadNo',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "车辆状态",
    field: 'vehicleStatus',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "vehicle_status"
    },
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '用户',
    field: 'userId',
    component: 'JSearchSelect',
    componentProps:{
      dict: "sys_user,realname,id"
    },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入用户!'},
             ];
    },
  },
  {
    label: '用户手机号',
    field: 'userPhone',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入用户手机号!'},
             ];
    },
  },
  {
    label: '行驶证',
    field: 'drivingLicense',
    component: 'JImageUpload',
    componentProps:{
      fileMax: 1
    },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入行驶证!'},
             ];
    },
  },
  {
    label: '车辆识别代号',
    field: 'drivingFVin',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入车辆识别代号!'},
             ];
    },
  },
  {
    label: '住址',
    field: 'drivingFAddr',
    component: 'Input',
  },
  {
    label: '发证日期',
    field: 'drivingFPubDate',
    component: 'Input',
  },
  {
    label: '发证单位',
    field: 'drivingFPubOrg',
    component: 'Input',
  },
  {
    label: '品牌型号',
    field: 'drivingFBrandModel',
    component: 'Input',
  },
  {
    label: '所有人',
    field: 'drivingFAny',
    component: 'Input',
  },
  {
    label: '使用性质',
    field: 'drivingFUseProperty',
    component: 'Input',
  },
  {
    label: '发动机号码',
    field: 'drivingFEngineNo',
    component: 'Input',
  },
  {
    label: '号牌号码',
    field: 'drivingFVehicleNo',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入号牌号码!'},
             ];
    },
  },
  {
    label: '注册日期',
    field: 'drivingFRegDate',
    component: 'Input',
  },
  {
    label: '检验记录',
    field: 'drivingBCheckRecord',
    component: 'Input',
  },
  {
    label: '核定载质量',
    field: 'drivingBVgwr',
    component: 'Input',
  },
  {
    label: '整备质量',
    field: 'drivingBCurbWeight',
    component: 'Input',
  },
  {
    label: '外廓尺寸',
    field: 'drivingBLwh',
    component: 'Input',
  },
  {
    label: ' 核定载人数',
    field: 'drivingBPax',
    component: 'Input',
  },
  {
    label: '总质量',
    field: 'drivingBGvs',
    component: 'Input',
  },
  {
    label: '燃油类型',
    field: 'drivingBFuelType',
    component: 'Input',
  },
  {
    label: '准牵引总质量',
    field: 'drivingBGcwr',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'drivingBRemark',
    component: 'Input',
  },
  {
    label: '档案编号',
    field: 'drivingBDocNo',
    component: 'Input',
  },
  {
    label: '号牌号码',
    field: 'drivingBVehicleNo',
    component: 'Input',
  },
  {
    label: '证芯编号',
    field: 'drivingBCcn',
    component: 'Input',
  },
  {
    label: '道路运输证',
    field: 'roadTransportCertificate',
    component: 'JImageUpload',
    componentProps:{
      fileMax: 1
    },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入道路运输证!'},
             ];
    },
  },
  {
    label: '道路运输证号',
    field: 'roadNo',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入道路运输证号!'},
             ];
    },
  },
  {
    label: '车牌号码',
    field: 'roadVehicleNo',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入车牌号码!'},
             ];
    },
  },
  {
    label: '经济类型',
    field: 'roadEconType',
    component: 'Input',
  },
  {
    label: '经营范围',
    field: 'roadBusiRange',
    component: 'Input',
  },
  {
    label: '车辆类型',
    field: 'roadVehicleType',
    component: 'Input',
  },
  {
    label: '吨座位',
    field: 'roadTon',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'roadRemark',
    component: 'Input',
  },
  {
    label: '经营许可证号',
    field: 'roadBusiPermitNo',
    component: 'Input',
  },
  {
    label: '车辆毫米_高',
    field: 'roadVehicleMmHeight',
    component: 'Input',
  },
  {
    label: '车辆毫米_宽',
    field: 'roadVehicleMmWeight',
    component: 'Input',
  },
  {
    label: '车辆毫米_长',
    field: 'roadVehicleMmLong',
    component: 'Input',
  },
  {
    label: '发证日期',
    field: 'roadPubDate',
    component: 'Input',
  },
  {
    label: '地址',
    field: 'roadAddr',
    component: 'Input',
  },
  {
    label: '业户名称',
    field: 'roadUserName',
    component: 'Input',
  },
  {
    label: '初领日期',
    field: 'roadFirstDate',
    component: 'Input',
  },
  {
    label: '车辆状态',
    field: 'vehicleStatus',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "vehicle_status"
    },
  },
  {
    label: '状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "row_status"
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  userId: {title: '用户',order: 0,view: 'sel_search', type: 'string',dictTable: "sys_user", dictCode: 'id', dictText: 'realname',},
  userPhone: {title: '用户手机号',order: 1,view: 'text', type: 'string',},
  drivingLicense: {title: '行驶证',order: 2,view: 'image', type: 'string',},
  drivingFVin: {title: '车辆识别代号',order: 3,view: 'text', type: 'string',},
  drivingFAddr: {title: '住址',order: 4,view: 'text', type: 'string',},
  drivingFPubDate: {title: '发证日期',order: 5,view: 'text', type: 'string',},
  drivingFPubOrg: {title: '发证单位',order: 6,view: 'text', type: 'string',},
  drivingFBrandModel: {title: '品牌型号',order: 7,view: 'text', type: 'string',},
  drivingFAny: {title: '所有人',order: 8,view: 'text', type: 'string',},
  drivingFUseProperty: {title: '使用性质',order: 9,view: 'text', type: 'string',},
  drivingFEngineNo: {title: '发动机号码',order: 10,view: 'text', type: 'string',},
  drivingFVehicleNo: {title: '号牌号码',order: 11,view: 'text', type: 'string',},
  drivingFRegDate: {title: '注册日期',order: 12,view: 'text', type: 'string',},
  drivingBCheckRecord: {title: '检验记录',order: 13,view: 'text', type: 'string',},
  drivingBVgwr: {title: '核定载质量',order: 14,view: 'text', type: 'string',},
  drivingBCurbWeight: {title: '整备质量',order: 15,view: 'text', type: 'string',},
  drivingBLwh: {title: '外廓尺寸',order: 16,view: 'text', type: 'string',},
  drivingBPax: {title: ' 核定载人数',order: 17,view: 'text', type: 'string',},
  drivingBGvs: {title: '总质量',order: 18,view: 'text', type: 'string',},
  drivingBFuelType: {title: '燃油类型',order: 19,view: 'text', type: 'string',},
  drivingBGcwr: {title: '准牵引总质量',order: 20,view: 'text', type: 'string',},
  drivingBRemark: {title: '备注',order: 21,view: 'text', type: 'string',},
  drivingBDocNo: {title: '档案编号',order: 22,view: 'text', type: 'string',},
  drivingBVehicleNo: {title: '号牌号码',order: 23,view: 'text', type: 'string',},
  drivingBCcn: {title: '证芯编号',order: 24,view: 'text', type: 'string',},
  roadTransportCertificate: {title: '道路运输证',order: 25,view: 'image', type: 'string',},
  roadNo: {title: '道路运输证号',order: 26,view: 'text', type: 'string',},
  roadVehicleNo: {title: '车牌号码',order: 27,view: 'text', type: 'string',},
  roadEconType: {title: '经济类型',order: 28,view: 'text', type: 'string',},
  roadBusiRange: {title: '经营范围',order: 29,view: 'text', type: 'string',},
  roadVehicleType: {title: '车辆类型',order: 30,view: 'text', type: 'string',},
  roadTon: {title: '吨座位',order: 31,view: 'text', type: 'string',},
  roadRemark: {title: '备注',order: 32,view: 'text', type: 'string',},
  roadBusiPermitNo: {title: '经营许可证号',order: 33,view: 'text', type: 'string',},
  roadVehicleMmHeight: {title: '车辆毫米_高',order: 34,view: 'text', type: 'string',},
  roadVehicleMmWeight: {title: '车辆毫米_宽',order: 35,view: 'text', type: 'string',},
  roadVehicleMmLong: {title: '车辆毫米_长',order: 36,view: 'text', type: 'string',},
  roadPubDate: {title: '发证日期',order: 37,view: 'text', type: 'string',},
  roadAddr: {title: '地址',order: 38,view: 'text', type: 'string',},
  roadUserName: {title: '业户名称',order: 39,view: 'text', type: 'string',},
  roadFirstDate: {title: '初领日期',order: 40,view: 'text', type: 'string',},
  vehicleStatus: {title: '车辆状态',order: 41,view: 'list', type: 'string',dictCode: 'vehicle_status',},
  status: {title: '状态',order: 42,view: 'list', type: 'string',dictCode: 'row_status',},
};
